package data;

import java.util.List;

public class RoleInfoDao {
	public static int countAll(DaoSession daoSession){
		return (Integer)daoSession.selectOne(
			"FINGERDB_ROLEINFO.countAll");		
	}
    @SuppressWarnings("unchecked")
	public static List<RoleInfoBean> selectAll(DaoSession daoSession, String deptno) {
    	return (List<RoleInfoBean>)daoSession.selectList(
    			"FINGERDB_ROLEINFO.selectAll", deptno);
    }
	public static void insert(DaoSession daoSession, RoleInfoBean roleInfo){
		daoSession.insert("FINGERDB_ROLEINFO.insert", roleInfo);
	}
	
	public static void update(DaoSession daoSession, RoleInfoBean roleInfo){
		daoSession.insert("FINGERDB_ROLEINFO.update", roleInfo);
	}

	public static int delete(DaoSession daoSession, String roleno){
		return daoSession.delete("FINGERDB_ROLEINFO.delete", roleno);
	}
	
	public static RoleInfoBean select(DaoSession daoSession, String roleno){
		return (RoleInfoBean)daoSession.selectOne(
			"FINGERDB_ROLEINFO.select", roleno);
	}
	
	public static RoleInfoBean selectByRoleName(DaoSession daoSession, String rolename){
		return (RoleInfoBean)daoSession.selectOne(
			"FINGERDB_ROLEINFO.selectbyrolename", rolename);
	}
}
